import Goods from "./Goods";
import {isExperationDateLess} from "./methods/SellInMethod";
import {updateGoodsValueToMin} from "./methods/qualityMethods";

class BackstagePass extends Goods{
    constructor(type: string, SellIn: number, Quality: number) {
        super(type, SellIn, Quality)
    }
    updateGoodsInfo() {
        this.isOutOfRange()
        this.updateQualityByAdd()
        if(isExperationDateLess(this.sellIn, 11)) {
            this.updateQualityByAdd()
        }if(isExperationDateLess(this.sellIn, 6)) {
            this.updateQualityByAdd()
        }
        this.updateExperationDateByMinus()
        if(isExperationDateLess(this.sellIn, 0)) {
            this.quality = updateGoodsValueToMin()
        }
    }
}
export default BackstagePass